#ifndef __74HC595_H_
#define __74HC595_H_

#include "bsp_gpio.h"

#define HC_A  (0x01)
#define HC_B  (0x02)
#define HC_C  (0x04)
#define HC_D  (0x08)
#define HC_E  (0x10)
#define HC_F  (0x20)
#define HC_G  (0x40)
#define HC_H  (0x80)

#ifndef LED_ON
#define LED_ON (0)
#endif

#ifndef LED_OFF
#define LED_OFF (1u)
#endif

void HC595_SetPin(uint8_t bits,uint8_t onff);
void HC595_Refresh(void);


#define MT_MODE(i) HC595_SetPin(HC_A,i);
#define A_Sel(i) HC595_SetPin(HC_D,i);
#define mA_Sel(i) HC595_SetPin(HC_E,i);
#define uA_Sel(i) HC595_SetPin(HC_F,i);
#define A0_Sel(i) HC595_SetPin(HC_G,i);
#define A1_Sel(i) HC595_SetPin(HC_H,i);

#define LEDR(i) HC595_SetPin(HC_B,i);
#define LEDG(i) HC595_SetPin(HC_C,i);


#endif //__74HC595_H_ 


